﻿using System;
using System.Collections.Generic;
using Library.Collections.Specialized;
using INDEX = System.UInt64;

namespace Library.Linq
{
    public static class ArrayEnumeration
    {
        public static IEnumerator<T> GetEnumerator<T>(this T[] array, INDEX offset, INDEX count)
        {
            return new ArrayEnumerator<T>(array, offset, count);
        }
        public static IEnumerator<T> GetEnumerator<T>(this T[] array, INDEX offset, INDEX count, Direction direction)
        {
            return (direction == Direction.Forward) ? (IEnumerator<T>)new ArrayEnumerator<T>(array, offset, count) : (IEnumerator<T>)new ArrayEnumeratorReversed<T>(array, offset, count);
        }
    }
}
